<template>
  <div>
    <div class="back">
      <span @click="back"></span>{{title}}
    </div>
    <div class="block"></div>
  </div>
</template>

<script>
  export default {
    name: 'back',
    data () {
      return{
        
      }
    },
    props:['title','path'],
    methods:{
      back(){
        if(this.path){
          this.$router.push({path:this.path})
        }else{
          this.$router.back();
        }
      }
    },
    mounted(){
        
    }
  }
</script>

<style lang="less" scoped>
.block{
  height: 30px;
  margin-bottom: 10px;
}
.back{
  line-height: 30px;
  background: #0099d9;
  text-align: center;
  color: #fff;
  font-size: 15px;
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 750px;
  span{
    position: absolute;
    left: 12px;
    top:0;
    bottom:0;
    margin: auto;
    width: 10px;
    height: 10px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
  }
}
</style>